//----------------------------------Include-------------------------------------
#include "mcu.h"
//------------------------------------------------------------------------------

//PY00--TDO     PY01--TDI    PY02--TCK    PY03--TMS    PY04--TRST
//PA21--boot1   PA20--boot0

//--------------------------------Public Func-----------------------------------
void mcu_init_do(void)
{
//periph clock
  
//output
  //PA27  --LEDR
  //PB01  --LEDG
  //PB19  --LEDB
  HPM_IOC->PAD[IOC_PAD_PA27].FUNC_CTL = IOC_PA27_FUNC_CTL_GPIO_A_27;
  HPM_IOC->PAD[IOC_PAD_PB01].FUNC_CTL = IOC_PB01_FUNC_CTL_GPIO_B_01;
  HPM_IOC->PAD[IOC_PAD_PB19].FUNC_CTL = IOC_PB19_FUNC_CTL_GPIO_B_19;
  
  //init and default output
//gpio_set_pin_output_with_initial(HPM_GPIO0,  GPIO_DO_GPIOA,  27,  1);   //1亮0灭
  gpio_set_pin_output_with_initial(HPM_GPIO0,  GPIO_DO_GPIOB,  01,  1);   //1亮0灭
//gpio_set_pin_output_with_initial(HPM_GPIO0,  GPIO_DO_GPIOB,  19,  1);   //1亮0灭
}

//LED
void mcu_led_toggle(void)
{
//gpio_toggle_pin(HPM_GPIO0, GPIO_DO_GPIOA, 27);
  gpio_toggle_pin(HPM_GPIO0, GPIO_DO_GPIOB, 01);
//gpio_toggle_pin(HPM_GPIO0, GPIO_DO_GPIOB, 19);
}
//------------------------------------EOF---------------------------------------



